home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 January: Mac OS SDK / Dev.CD Jan 96 SDK / Dev.CD Jan 96 SDK1.toast / Development Kits (Disc 1) / AOCE / Development Tools / Sample Code / SampleTemplate / Sample Template / Source / AlbumSublistPage2.r < prev    next >
Encoding:
Text File  |  1993-09-07  |  11.5 KB  |  339 lines  |  [TEXT/MPS ]

  1. #include "Types.r"
  2. #include "OCETemplates.h"
  3. #include "OCE.r"
  4. #include "Track.h"
  5.  
  6.  
  7. /////////////////////////////////////////////////////////////////////////
  8. //
  9. // BOOKKEEPING - this is an aspect template with this base resource id
  10. //
  11. /////////////////////////////////////////////////////////////////////////
  12.  
  13. #define kAlbum2ndInfoPageAspect        kDETThirdID
  14.  
  15. resource 'deta' (kAlbum2ndInfoPageAspect, purgeable) {
  16.     0,                    // Drop priority
  17.     dropCheckAlways,    // Drop check flag
  18.     notMainAspect        // Not the main aspect
  19. };
  20.  
  21. resource 'rstr' (kAlbum2ndInfoPageAspect+kDETTemplateName, purgeable) {
  22.     "Album Second Info Page Aspect"
  23. };
  24.  
  25.  
  26.  
  27. /////////////////////////////////////////////////////////////////////////
  28. //
  29. // BINDING - associate this aspect with records of this type
  30. //
  31. /////////////////////////////////////////////////////////////////////////
  32.  
  33. resource 'rstr' (kAlbum2ndInfoPageAspect+kDETRecordType, purgeable) {
  34.     "Album"
  35. };
  36.  
  37.  
  38. // Icons
  39. include "AlbumIcons" 'ICN#'(0) as 'ICN#'(kAlbum2ndInfoPageAspect+kDETAspectMainBitmap, purgeable);
  40. include "AlbumIcons" 'icl4'(0) as 'icl4'(kAlbum2ndInfoPageAspect+kDETAspectMainBitmap, purgeable);
  41. include "AlbumIcons" 'icl8'(0) as 'icl8'(kAlbum2ndInfoPageAspect+kDETAspectMainBitmap, purgeable);
  42.  
  43.  
  44. /////////////////////////////////////////////////////////////////////////
  45. //
  46. // ASPECT PROPERTIES - shared between aspect and info page(s)
  47. //
  48. /////////////////////////////////////////////////////////////////////////
  49.  
  50. #define prNumTracks                    kDETFirstDevProperty
  51. #define prPlayingTimeHours            kDETFirstDevProperty + 1
  52. #define prPlayingTimeMinutes        kDETFirstDevProperty + 2
  53. #define prPlayingTimeSeconds        kDETFirstDevProperty + 3
  54.  
  55.  
  56. //----------------------------------------------------------------------
  57. //
  58. // Lookup resource - what attributes to lookup,
  59. //                     how to assign them to properties
  60. //
  61. //----------------------------------------------------------------------
  62.  
  63. resource 'dett' (kAlbum2ndInfoPageAspect+kDETAspectLookup, purgeable) {
  64.     {
  65.     {"Album Track Info"}, typeBinary,
  66.         useForInput, useForOutput, notInSublist, isNotAlias, isNotRecordRef,
  67.         {
  68.             'word', prNumTracks, 0;
  69.             'long', prPlayingTimeHours, 0;
  70.             'long', prPlayingTimeMinutes, 0;
  71.             'long', prPlayingTimeSeconds, 0;
  72.         };
  73.  
  74.     {"Track"}, typeBinary,
  75.         notForInput, notForOutput, useInSublist, isNotAlias, isNotRecordRef,
  76.         {};
  77.     }
  78. };
  79.  
  80.  
  81. //----------------------------------------------------------------------
  82. //
  83. // Drag and Drop Information
  84. //
  85. //----------------------------------------------------------------------
  86.  
  87. resource 'rstr' (kAlbum2ndInfoPageAspect+kDETAspectDragInString, purgeable) {
  88.     "Do you want to add %3%“^3”%the selected items% to the track address list of *0x/the/* ^1 “^2”?"
  89. };
  90.  
  91. resource 'rst#' (kAlbum2ndInfoPageAspect+kDETAspectAttrDragIn, purgeable) {
  92.     {
  93.     "", "Track", "Track"
  94.     }
  95. };
  96.  
  97.  
  98. //----------------------------------------------------------------------
  99. //
  100. // Sublist Sorting Information
  101. //
  102. //----------------------------------------------------------------------
  103.  
  104. resource 'detm' (kAlbum2ndInfoPageAspect+kDETAspectViewMenu, purgeable) {
  105.     kAlbum2ndInfoPageAspect+kDETAspectViewMenu,
  106.     {
  107.     kDETAspectName,            "by Title";
  108.     -prTrackNumber,            "by Track Number";
  109.     }
  110. };
  111.  
  112. resource 'detp' (kAlbum2ndInfoPageAspect+kDETAspectReverseSort, purgeable) {
  113.     {
  114.     prTrackNumber
  115.     }
  116. };
  117.  
  118.  
  119.  
  120. //----------------------------------------------------------------------
  121. //
  122. // Balloon help for the properties
  123. //
  124. //----------------------------------------------------------------------
  125.  
  126. resource 'rst#' (kAlbum2ndInfoPageAspect+kDETAspectBalloons,purgeable) {
  127.     {
  128.     "The number of tracks on the album.",            "The number of tracks on the album. Uneditable because the record is locked or access controled.",
  129.     "The number of hours of music on the album.",    "The number of hours of music on the album. Uneditable because the record is locked or access controled.",
  130.     "The number of minutes of music on the album.",    "The number of minutes of music on the album. Uneditable because the record is locked or access controled.",
  131.     "The number of seconds of music on the album.",    "The number of seconds of music on the album. Uneditable because the record is locked or access controled.",
  132.     }
  133. };
  134.  
  135.  
  136.  
  137. // --------------------------------------------------------------------
  138. // --------------------------------------------------------------------
  139. //
  140. // Album Information Page
  141. //
  142. // --------------------------------------------------------------------
  143. // --------------------------------------------------------------------
  144.  
  145.  
  146. /////////////////////////////////////////////////////////////////////////
  147. //
  148. // BOOKKEEPING - this is an information page template with this base resource id
  149. //                 and this view
  150. //
  151. /////////////////////////////////////////////////////////////////////////
  152.  
  153. #define kAlbum2ndInfoPage            kDETFourthID
  154.  
  155. #define kTitleTop                    (85)
  156. #define kTitleBottom                (kTitleTop+12)
  157. #define kSublistTop                    (kTitleBottom+2)
  158. #define kSublistBottom                (kDETRecordInfoWindHeight-40)
  159. #define kSublistLeft                (12)
  160. #define kSublistRight                (kDETRecordInfoWindWidth-12)
  161.  
  162. resource 'deti' (kAlbum2ndInfoPage, purgeable) {
  163.     2000,
  164.     {kSublistTop, kSublistLeft, kSublistBottom, kSublistRight},
  165.     selectFirstText, 
  166.     {
  167.         kDETNoProperty, kDETNoProperty, kAlbum2ndInfoPage;
  168.         kDETNoProperty, kDETNoProperty, kAlbum2ndInfoPage + 1;
  169.         kDETNoProperty, kDETNoProperty, kAlbum2ndInfoPage + 2;
  170.         kDETNoProperty, kDETNoProperty, kAlbum2ndInfoPage + 3;
  171.     },
  172.     {
  173.         kDETNoProperty, kDETNoProperty, kAlbum2ndInfoPage + 4;
  174.     }
  175. };
  176.  
  177. resource 'rstr' (kAlbum2ndInfoPage+kDETTemplateName, purgeable) {
  178.     "Album 2nd Info Page"
  179. };
  180.  
  181. resource 'rstr' (kAlbum2ndInfoPage+kDETInfoPageName, purgeable) {
  182.     "Track Info"
  183. };
  184.  
  185.  
  186. /////////////////////////////////////////////////////////////////////////
  187. //
  188. // BINDING - associate this information page with records of this type
  189. //             and with this aspect
  190. //
  191. /////////////////////////////////////////////////////////////////////////
  192.  
  193. resource 'rstr' (kAlbum2ndInfoPage+kDETRecordType, purgeable) {
  194.     "Album"
  195. };
  196.  
  197. resource 'rstr' (kAlbum2ndInfoPage+kDETInfoPageMainViewAspect, purgeable) {
  198.     "Album Second Info Page Aspect"
  199. };
  200.  
  201.  
  202. /////////////////////////////////////////////////////////////////////////
  203. //
  204. // VIEWS - what you see in this information page
  205. //
  206. /////////////////////////////////////////////////////////////////////////
  207.  
  208.  
  209. #define kMyFirstColumnLeft                (55)
  210. #define kMyFirstColumnRight                (kMyFirstColumnLeft + 120)
  211. #define kEditTextWidth                    (23)
  212. #define kSpaceBeforeEditDesc            (25)
  213. #define kNumEditColumns                    (3)
  214. #define kMyEditColumnWidth                (70)
  215. #define k1stEditColumnLeft                (kMyFirstColumnRight + 2)
  216. #define k2ndEditColumnLeft                (k1stEditColumnLeft + kMyEditColumnWidth)
  217. #define k3rdEditColumnLeft                (k2ndEditColumnLeft + kMyEditColumnWidth)
  218. #define k4thEditColumnLeft                (k3rdEditColumnLeft + kMyEditColumnWidth)
  219.  
  220. #define kNumTracksTop                    (40)
  221. #define kNumTracksBottom                (kNumTracksTop + kDETAppFontLineHeight + 4)
  222. #define kPlayingTimeTop                    (kNumTracksBottom + 4)
  223. #define kPlayingTimeBottom                (kPlayingTimeTop + kDETAppFontLineHeight + 4)
  224. #define k2ndColumnRightInset            (kDETRecordInfoWindWidth - 10)
  225.  
  226. #define kButtonTop        (kSublistBottom+15)
  227. #define kButtonBottom    (kButtonTop+16)
  228. #define kOpenLeft        62
  229. #define kOpenRight        112
  230. #define kAddLeft        208
  231. #define kAddRight        258
  232. #define kRemoveLeft        270
  233. #define kRemoveRight    320
  234.  
  235. #define kIconLeft        2
  236. #define kNameLeft        22
  237. #define kTrackNumberLeft        162
  238. #define kPrefLeft        285
  239. #define kPrefRight        305
  240.  
  241. #define kIconEntryTop        -7
  242. #define kIconEntryBottom    9
  243. #define kEntryTop            -5
  244. #define kEntryBottom        9
  245.  
  246. resource 'detv' (kAlbum2ndInfoPage, purgeable) {
  247.     {
  248.     kDETSubpageIconRect, kDETNoFlags, kDETAspectMainBitmap,
  249.     Bitmap { kDETLargeIcon };
  250.     }
  251. };
  252.  
  253. resource 'detv' (kAlbum2ndInfoPage + 1, purgeable) {
  254.     {
  255.     {kNumTracksTop, kMyFirstColumnLeft, kNumTracksBottom, kMyFirstColumnRight}, kDETNoFlags, kDETNoProperty,
  256.     StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETRight, kDETBold,
  257.         "Number of tracks:" };
  258.  
  259.     {kNumTracksTop-2, k1stEditColumnLeft, kNumTracksBottom-2, k1stEditColumnLeft + kEditTextWidth}, kDETEnabled + kDETNumericOnly, prNumTracks,
  260.     EditText { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal };
  261.     }
  262. };
  263.  
  264. resource 'detv' (kAlbum2ndInfoPage + 2, purgeable) {
  265.     {
  266.     {kPlayingTimeTop, kMyFirstColumnLeft, kPlayingTimeBottom, kMyFirstColumnRight}, kDETNoFlags, kDETNoProperty,
  267.     StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETRight, kDETBold,
  268.         "Total playing time:" };
  269.  
  270.     {kPlayingTimeTop-2, k1stEditColumnLeft, kPlayingTimeBottom-2, k1stEditColumnLeft + kEditTextWidth}, kDETEnabled + kDETNumericOnly, prPlayingTimeHours,
  271.     EditText { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal };
  272.  
  273.     {kPlayingTimeTop, k1stEditColumnLeft + kSpaceBeforeEditDesc, kPlayingTimeBottom, k2ndEditColumnLeft}, kDETNoFlags, kDETNoProperty,
  274.     StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal,
  275.         "Hours" };
  276.  
  277.     {kPlayingTimeTop-2, k2ndEditColumnLeft, kPlayingTimeBottom-2, k2ndEditColumnLeft + kEditTextWidth}, kDETEnabled + kDETNumericOnly, prPlayingTimeMinutes,
  278.     EditText { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal };
  279.  
  280.     {kPlayingTimeTop, k2ndEditColumnLeft + kSpaceBeforeEditDesc, kPlayingTimeBottom, k3rdEditColumnLeft}, kDETNoFlags, kDETNoProperty,
  281.     StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal,
  282.         "Minutes" };
  283.  
  284.     {kPlayingTimeTop-2, k3rdEditColumnLeft, kPlayingTimeBottom-2, k3rdEditColumnLeft + kEditTextWidth}, kDETEnabled + kDETNumericOnly, prPlayingTimeSeconds,
  285.     EditText { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal };
  286.  
  287.     {kPlayingTimeTop, k3rdEditColumnLeft + kSpaceBeforeEditDesc, kPlayingTimeBottom, k4thEditColumnLeft}, kDETNoFlags, kDETNoProperty,
  288.     StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal,
  289.         "Seconds" };
  290.     }
  291. };
  292.  
  293. resource 'detv' (kAlbum2ndInfoPage + 3, purgeable) {
  294.     {
  295.     {kSublistTop-1, kSublistLeft-1, kSublistBottom+1, kSublistRight+1}, kDETNoFlags, kDETNoProperty,
  296.         Box { kDETUnused };
  297.  
  298.     {kTitleTop, kSublistLeft+kNameLeft, kTitleBottom, kSublistLeft+kTrackNumberLeft-2},
  299.         kDETNoFlags, kDETAspectName,
  300.         StaticCommandTextFromView { kDETDefaultFont, kDETDefaultFontSize, kDETLeft, kDETUnderline, "Title",
  301.                         kDETChangeViewCommand, -1 };
  302.  
  303.     {kTitleTop, kSublistLeft+kTrackNumberLeft, kTitleBottom, kSublistLeft+kPrefLeft-2},
  304.         kDETNoFlags, prTrackNumber,
  305.         StaticCommandTextFromView { kDETDefaultFont, kDETDefaultFontSize, kDETLeft, kDETNormal, "Track Number",
  306.                         kDETChangeViewCommand, -2 }; 
  307.  
  308.     {kButtonTop, kOpenLeft, kButtonBottom, kOpenRight}, 
  309.         kDETNoFlags, kDETOpenSelectedItems,
  310.         Button { kDETApplicationFont, 10,  kDETCenter, kDETNormal, "Open", kDETOpenSelectedItems };
  311.  
  312.     {kButtonTop, kAddLeft, kButtonBottom, kAddRight}, 
  313.         kDETNoFlags, kDETAddNewItem,
  314.         Button { kDETApplicationFont, 10, kDETCenter, kDETNormal, "Add…", kDETAddNewItem };
  315.  
  316.     {kButtonTop, kRemoveLeft, kButtonBottom, kRemoveRight}, 
  317.         kDETNoFlags, kDETRemoveSelectedItems,
  318.         Button { kDETApplicationFont, 10, kDETCenter, kDETNormal, "Remove", kDETRemoveSelectedItems };
  319.     }
  320. };
  321.  
  322.  
  323. resource 'detv' (kAlbum2ndInfoPage + 4, purgeable) {
  324.     {
  325.     {kIconEntryTop, kIconLeft, kIconEntryBottom, kNameLeft-4},
  326.         kDETHilightIfSelected, kDETAspectMainBitmap,
  327.         Bitmap { kDETMiniIcon };
  328.  
  329.     {kEntryTop, kNameLeft, kEntryBottom, kTrackNumberLeft-2},
  330.         kDETHilightIfSelected + kDETDynamicSize, kDETAspectName,
  331.         EditText { kDETDefaultFont, kDETDefaultFontSize, kDETLeft, kDETNormal };
  332.  
  333.     {kEntryTop, kTrackNumberLeft, kEntryBottom, kPrefLeft-2},
  334.         kDETHilightIfSelected + kDETDynamicSize, prTrackNumber,
  335.         EditText { kDETDefaultFont, kDETDefaultFontSize, kDETLeft, kDETNormal };
  336.     }
  337. };
  338.  
  339.